from fastapi import APIRouter,File,UploadFile

file_upload = APIRouter()


@file_upload.post("/upload/")
def upload_file(file: UploadFile = File(...)):
    return {"filename": file.filename}

@file_upload.post("/save/")
def save_file(file: bytes = File(...)):
    with open("file.txt", "wb") as f:
        f.write(file)
    return {"filename": "file.txt"}



